<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/layui.css" rel="stylesheet">
    <link href="css/layui.mobile.css" rel="stylesheet">
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="css/styles.css">
    <title>学生信息-大学课堂评价系统</title>


    <style>
        a:hover{text-decoration:none;}
        a.active{text-decoration:none;}
        html,body{height: 100%;margin: 0;}
        .row{margin-bottom: 10px}

        body{background: #f9f9f9;font-family: -apple-system,"Microsoft Yahei","Helvetica Neue",Helvetica,Arial,sans-serif;}


        @font-face {
            font-family: "lantingxihei";
            src: url("fonts/FZLTCXHJW.TTF");
        }

		/* 导航栏 */
		.header {
			background-color: #DEDEDE;
		}
		.container {
			padding-right: 40px;
			padding-left: 40px;
		}
		.navbar-nav{
			margin-left: 20px;
		}
		
        /* modal 模态框*/
        #invite-user .modal-body {
            overflow: hidden;
        }
        #invite-user .modal-body .form-label {
            margin-bottom: 16px;
            font-size:14px;
        }
        #invite-user .modal-body .form-invite {
            width: 80%;
            padding: 6px 12px;
            background-color: #eeeeee;
            border: 1px solid #cccccc;
            border-radius: 5px;
            float: left;
            margin-right: 10px;
        }
        #invite-user .modal-body .msg-modal-style {
            background-color: #7dd383;
            margin-top: 10px;
            padding: 6px 0;
            text-align: center;
            width: 100%;
        }
        #invite-user .modal-body .modal-flash {
            position: absolute;
            top: 53px;
            right: 74px;
            z-index: 999;
        }
        /* end modal */

        .en-footer {
            padding: 30px;
            text-align: center;
            font-size: 14px;
        }
    </style>


</head>

<body>

<jsp:include page="top.jsp"/>
<div class="container layout layout-margin-top">
	<ol class="breadcrumb">
		<li><a href="index.html">主页</a></li>
		<li><a href="class.html">班级信息</a></li>
		<li class="active">学生信息</li>
	</ol>
    <!--中心-->
    <div class="row">
		<div class="col-md-12">
						<div class="panel panel-success">
							<!-- Default panel contents -->
							<div class="panel-heading">班级信息</div>
							<!-- Table -->
							<table class=" text-center table table-hover table-striped">
								<!-- On rows -->
								<thead>
									<tr>
										<th>序号</th>
										<th>姓名</th>
										<th>年级</th>
										<th>学号</th>
										<th>所属班级</th>
										<th>所属小组</th>
										<%if(null != session.getAttribute("SESSION_TEACHER")){%>
										<th>操作</th>
										<%}%>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${requestScope.studentList }" var="s" varStatus="status">
									<tr>
										<td>${status.count}</td>
										<td>${s.studentName}</td>
										<td>${s.gclass.classYear}级</td>
										<td>${s.studentID}</td>
										<td>${s.gclass.className}</td>
										<td>${s.ggroup.groupName}</td>
										<%if(null != session.getAttribute("SESSION_TEACHER")){%>
										<td>
											<a href="#modification" data-id="${s.studentID}" data-name="${s.studentName}" data-toggle="modal">修改</a>
										</td>
										<%}%>
									</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>
			<!--分页-->
			<div class="text-center">
					<nav aria-label="Page navigation">
							<ul class="pagination">
									<c:choose>
									<c:when test="${pagination.isHasPreviousPage() eq true}">
										<li>
										<a href="ClassInfoServlet?action=studentList&pageNo=${pagination.pageNo - 1}" aria-label="Previous">
										</c:when>
										<c:when test="${pagination.isHasPreviousPage() eq false}">
										<li class="disabled">
										<a aria-label="Previous">
										</c:when>
									</c:choose>
										<span aria-hidden="true">上一页</span>
										</a>
									</li>
									<c:forEach var="i" begin="1" end="${pagination.totalPages}" varStatus="status">
										<li><a href="ClassInfoServlet?action=studentList&pageNo=${status.count}">${status.count}</a></li>
									</c:forEach>
									
									<c:choose>
									<c:when test="${pagination.isHasNextPage() eq true}">
										<li>
										<a href="ClassInfoServlet?action=studentList&pageNo=${pagination.pageNo + 1}" aria-label="Previous">
										</c:when>
										<c:when test="${pagination.isHasNextPage() eq false}">
										<li class="disabled">
										<a aria-label="Previous">
										</c:when>
									</c:choose>
										<span aria-hidden="true">下一页</span>
										</a>
									</li>
							</ul>
					</nav>
			</div><!--分页-->
		</div>
    </div><!--中心-row-->
</div><!--container-->
<!-- 登录模态框 -->
<div class="modal fade" id="sign-modal" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <button type="button" class="close-modal" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <div class="modal-body">
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active">
                        <a href="#signin-form" aria-controls="signin-form" role="tab" data-toggle="tab">登录</a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane active" id="signin-form">
                        <form action="/login" method="post">
                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        <i class="fa fa-envelope" style="margin:0;"></i>
                                    </div>
                                    <input type="email" name="login" class="form-control" placeholder="请输入账户">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon">
                                        <i class="fa fa-lock" style="margin:0;"></i>
                                    </div>
                                    <input type="password" name="password" class="form-control" placeholder="请输入密码">
                                </div>
                            </div>
                            <div class="form-inline verify-code-item" style="display:none;">
                                <div class="form-group">
                                    <div class="input-group">
                                        <input type="text" name="captcha_v" class="form-control" placeholder="请输入验证码">
                                    </div>
                                </div>
                                <img class="verify-code" src="" source="https://www.shiyanlou.com/captcha.gif">
                            </div>
                            <div class="form-group remember-login">
                                <input name="remember" type="checkbox" value="y"> 下次自动登录
                                <a class="pull-right" href="../reset_password/index.html">忘记密码？</a>
                            </div>
                            <div class="form-group">
                                <input class="btn btn-primary" name="submit" type="submit" value="登录">
                            </div>
                            <div class="form-group error-msg">
                                <div class="alert alert-danger" role="alert"></div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 登陆模态框结束 -->
<!-- 修改信息模态框 -->
<div class="modal fade" id="modification" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h3 class="modal-title" id="">修改学生信息</h3>
      </div>
      <div class="modal-body">
        <form action="StudentInfoServlet"  method="post" class="form-horizontal">
        <input type="hidden" name="action" value="update">
			<div class="form-group">
				<label class="col-sm-2 control-label">所属班级</label>
				<div class="col-sm-10">
					<p class="form-control-static">计算机科学与技术</p>
				</div>
			</div>
			<div class="form-group">
            <label for="student-ID" class="control-label col-sm-2">学号:</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="studentID" readonly>
			</div>
          </div>
			<div class="form-group">
				<label for="name" class="control-label col-sm-2">姓名:</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" id="name" name="studentName" >
				</div>
			</div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="submit" class="btn btn-primary">保存</button>
      </div>
	  </form>
    </div>
  </div>
</div>
<!-- 修改信息模态框结束 -->



<jsp:include page="footer.jsp"/>

<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/layui.all.js"></script>
<script type="text/javascript">
$("#modification").on('shown.bs.modal',function(e) {
    //get data-id attribute of the clicked element
    var id = $(e.relatedTarget).data('id');
    var name = $(e.relatedTarget).data('name');
    //populate the textbox
    $(e.currentTarget).find('input[name="studentID"]').val(id);
    $(e.currentTarget).find('input[name="studentName"]').val(name);
});
</script>

</body>
</html>
